package com.example.testdistribution;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.LinearLayout;
import android.widget.ScrollView;

public class ScrollViewSofia extends ScrollView{
	public ScrollViewSofia(Context context) {
		super(context);
	}
	
	public ScrollViewSofia(Context context, AttributeSet attrs) {
		super(context, attrs);
	}
	
	public ScrollViewSofia(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
	}

	public void onScrollChanged(int l, int t, int oldl, int oldt){
		super.onScrollChanged(l, t, oldl, oldt);
		int idView = this.getId();
		int idBody = R.id.amortization_scroll;
		int idLeft = R.id.left_static_scroll;
		if(idView==idBody){
			LinearLayout parent = (LinearLayout)this.getParent();
			ScrollViewSofia leftColumn = (ScrollViewSofia)parent.getChildAt(0);
			leftColumn.scrollTo(l,t);
		}
		if(idView==idLeft){
			LinearLayout parent = (LinearLayout)this.getParent();
			ScrollViewSofia leftColumn = (ScrollViewSofia)parent.getChildAt(1);
			leftColumn.scrollTo(l,t);
		}		
		//this.get
	}
}
